package com.zlp.mall.upms.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.zlp.swagger.config.BaseSwaggerConfig;
import com.zlp.swagger.config.SwaggerProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.Arrays;

/**
 * 接口文档
 * https://xiaoym.gitee.io/knife4j/documentation/accessControl.html#_3-5-2-%E8%AE%BF%E9%97%AE%E9%A1%B5%E9%9D%A2%E5%8A%A0%E6%9D%83%E6%8E%A7%E5%88%B6
 * Swagger2API文档的配置
 */
@Configuration
@EnableSwagger2
@EnableKnife4j
@Profile({"local", "dev", "test"})
public class Swagger2Config extends BaseSwaggerConfig {


    @Override
    public SwaggerProperties swaggerProperties() {
        return SwaggerProperties.builder()
                .apiBasePackages(Arrays.asList("com.zlp.mall.upms.controller"))
                .title("upms-接口文档")
                .description("upms-接口文档")
                .contact(new SwaggerProperties.Contact("Zou.LiPing","http://127.0.0.1:3000/doc.html","865391093@qq.com"))
                .version("1.0")
                .enableSecurity(Boolean.TRUE)
                .build();
    }
}

